
<?php if (count($collection) != 0) : ?>
<?php $paginator = $this->load->view('medical/symptoms/paginator', array('related' => true), true); echo $paginator; ?>
<?php endif; ?>
<input type="hidden" name="current_page" id="current_page" value="<?php echo $current_page; ?>" />

<?php $this->load->view('medical/symptoms/message'); ?>
    <div class="block">
        <table class="gridview" width="100%" cellpadding="0" cellspacing="0" border="0">
            <thead>
            <tr>
                <td>Chọn</td>
                <td><b>ID</b></td>
                <td><b>Triệu chứng</b></td>
                <td><b>Thuộc bộ phận</b></td>
                <td><b>Ảnh minh họa</b></td>
                <td><b>Mô tả ngắn</b></td>
            </tr>
            </thead>
            <tbody>
                <tr class="filters">
                    <td colspan="6">
                        <input placeholder="ID" type="text" class="small_filter" name="filters[symptoms][id]" title="Tìm kiếm theo id triệu chứng lâm sàng" value="<?php echo isset($filters['symptoms']['id']) ? $filters['symptoms']['id'] : '' ;?>" style="margin-left: 70px" />
                        <input placeholder="Tên" style="width: 180px;margin: 0 25px 0 10px;" type="text" class="small_filter" name="filters[symptoms][name]" title="Tìm kiếm theo triệu chứng lâm sàng" value="<?php echo isset($filters['symptoms']['name']) ? $filters['symptoms']['name'] : '' ; ?>" />

                        <select name="filters[symptoms][parts_id]" id="parts_id" style="width: 160px;">

                        </select>

                        <button type="button" class="gray_btn" style="margin-left:10px;position:relative;top:2px"  onclick="return admin_medical_disease.filter_symptoms_related('symptoms_relate_list')">
                            <span>Tìm</span>
                        </button>
                        &nbsp;
                        <button type="button" class="gray_btn" style="position:relative;top:2px" onclick="return admin_medical_disease.reset_filter_symptoms('symptoms_relate_list')">
                            <span>Xóa lọc</span>
                        </button>
                    </td>
                </tr>
                <?php if (count($collection) != 0) : ?>
                <?php foreach ($collection as $symptoms) : ?>
                    <tr>
                        <input type="hidden" value="" class="edit_url" />
                        <td width="60px" valign="top">
                            <strong><a id="btn_symptoms_relate<?php echo $symptoms->id; ?>" onclick="return admin_medical_disease.add_symptoms_related(<?php echo $symptoms->id; ?>, '<?php echo htmlspecialchars($symptoms->name); ?>', '<?php echo site_url('admin/medical/symptoms/edit/id/' . $symptoms->id, true); ?>', 'symptoms_related')" title="Chọn triệu chứng liên quan" class="icon icon_add_blue" href="javascript:;void(0)"></a></strong>
                        </td>
                        <td width="60px" valign="top">
                            <?php echo $symptoms->id; ?>
                        </td>
                        <td valign="top">
                            <strong><a <?php if ($has_privilege_view) :?>href="<?php echo site_url('admin/medical/symptoms/edit/id/' . $symptoms->id, true); ?>"<?php endif; ?>><?php echo $symptoms->name; ?></a></strong>
                        </td>
                        <td width="180px" valign="top">
                            <?php echo $symptoms->parts_name; ?>
                        </td>
                        <td width="100px" valign="top">
                            <?php if (!empty($symptoms->image)) :?>
                            <a target="_blank" href="<?php echo render_src($symptoms->image); ?>"><img src="<?php echo render_src($symptoms->image); ?>" width="50px" style="vertical-align: middle; border: 2px solid #bbb" /></a>
                            <?php endif; ?>
                        </td>
                        <td width="260px" valign="top">
                            <?php echo $symptoms->description; ?>
                        </td>
                    </tr>
                <?php endforeach; ?>

                <?php else : ?>
                    <tr>
                        <td colspan="9" style="padding: 10px">
                            <p align="center">Danh sách triệu chứng trống trong thời điểm này hoặc truy vấn tìm kiếm không tìm thấy kết quả, <a href="<?php echo site_url('admin/medical/symptoms/filtered_list/' . $return_url, true); ?>">Thử lại</a></p>
                        </td>
                    </tr>
                <?php endif; ?>
            </tbody>
            <tfoot>

            </tfoot>
        </table>
    </div>
<?php if (count($collection) != 0) : ?>
<?php $paginator = $this->load->view('medical/symptoms/paginator', null, true); echo $paginator; ?>
<?php endif; ?>


<script type="text/javascript" src="<?php echo BASE_URL; ?>js/admin/medical/object/function.js"></script>
<script type="text/javascript">
    var allParts = <?php echo $list_parts;?>;//lấy hết bộ phận cơ thẻ
    var partsId = '<?php echo $filters['symptoms']['parts_id'] ; ?>';

    admin_medical_parts.showOptParts(allParts, 'parts_id', partsId);
</script>
